//
//  JBDataAPI.m
//  JBBasicDataViewModuleController
//
//  Created by Yongbin Zhang on 12/23/13.
//  Copyright (c) 2013 JustBen. All rights reserved.
//

#import "JBDataAPI.h"

#import "JBStruct.h"


@implementation JBDataAPI

+ (void)getEventListOfUser:(NSString *)user withSuccess:(void (^)(NSArray *list))success failure:(void (^)(NSInteger errorCode, NSString *errorMsg))failure
{
    //  TO DO
    
    NSMutableArray *list = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < 6; i++) {
        JBStructEvent *structEvent = [[JBStructEvent alloc] init];
        structEvent.title = @"圣诞快乐";
        structEvent.address = @"北京市 朝阳区 竞园";
        structEvent.startTime = @"上午 09:00";
        structEvent.endTime = @"上午 10:00";
        [list addObject:structEvent];
    }
    
    BOOL result = YES;
    if (result) {
        if (success) {
            success(list);
        }
    } else {
        if (failure) {
            failure(11111111, @"错误描述");
        }
    }
}

@end
